package com.starry.compose_study.compositionlocal

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.ColumnScope
import androidx.compose.foundation.layout.size
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.ButtonElevation
import androidx.compose.material3.Card
import androidx.compose.material3.CardColors
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.CardElevation
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp


@Composable
fun MyCard(
    elevation: CardElevation = CardDefaults.cardElevation(),
    colors: CardColors,
    content: @Composable ColumnScope.() -> Unit
) {
    Card(
        elevation = elevation,
        modifier = Modifier.size(200.dp),
        colors = colors,
        content = content
    )
}
@Composable
fun SampleCard() {
    Column {

        MyCard(
            colors = CardDefaults.cardColors(
                containerColor = MaterialTheme.colorScheme.onSurface.copy(
                    0.1f
                )
            )
        ) {

        }

        MyCard(
            colors = CardDefaults.cardColors(
                containerColor = MaterialTheme.colorScheme.onSurface.copy(
                    0.1f
                )
            )
        ) {

        }
    }
}

@Preview
@Composable
fun PreviewSampleCard(){
    SampleCard()
}

